<html>
    <head>
        <meta charset="utf-8">
        <title>突出显示Marker</title>
        <!-- leaflet的css样式 -->
        <link rel="stylesheet" href="../lib/leaflet.css" />
        <!-- leaflet的js库 -->
        <script type="text/javascript" src="../lib/leaflet.js"></script>

        <!-- 地图容器样式 -->
        <style>
            #mapDiv{
                width: 100%;
                height: 100%;
            }
        </style>
    </head>
    <body onload="init()">
        <!--地图的容器-->
        <div id="mapDiv"></div>
    </body>
</html>

<script type="text/javascript">
    var map = null; 

    function init(){

        map = L.map("mapDiv", {
                    layers: [
                        L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png'),
                    ],
                    center: [39.90,116.39],
                    zoom: 10,
                });


        //1.创建marker对象，并添加到地图上
        var marker = L.marker([39.90,116.39],{
            icon : L.icon({
                        iconUrl     : "../images/pin_2_64.png"
            }),
            title : "ddddd",
            //2. 设置Marker的riseOnHover属性为true
            riseOnHover   : true
        }).addTo(map);

        L.marker([39.91,116.40],{
            icon : L.icon({
                        iconUrl     : "../images/pin_g_2_64.png"
            }),
            title : "eeee",
            //2. 设置Marker的riseOnHover属性为true
            riseOnHover   : true
        }).addTo(map);

    }
</script>
    